<template>
	<view class="main">
		<div class="group-wrap">
			<div class="title">添加客服微信获取更多金币</div>
			<div class="text">
				<button @tap="copyWx">{{ wx }}点击复制微信</button>
			</div>
		</div>
		<div class="group-wrap">
			<div class="title">发布帖子，热度越高金币越多</div>
			<div class="text"><button @tap="goNewPost">去发帖</button></div>
		</div>
		<div class="group-wrap">
			<div class="title">邀请新用户，注册成功后可获得金币</div>
			<div class="text"><button @tap="copyShareUrl">复制链接发送给好友</button></div>
		</div>
	</view>
</template>

<script>
import { http } from '@/lib/js/request';
import { goPage, copy } from '@/lib/js/utils';
import { HOST } from '@/lib/js/constant';
import { modal } from '@/lib/js/dailog';
export default {
	data() {
		return {
			wx: uni.getStorageSync('config').wx
		};
	},
	onLoad() {},
	methods: {
		goNewPost(){
			goPage(`/pages/info/new`)
		},
		copyWx() {
			copy(this.wx, () => modal('复制成功，请打开微信添加好友'));
		},
		copyShareUrl() {
			copy(location.host + `/#/pages/index/index?uid=${uni.getStorageSync('user').id}`, () => modal('复制成功，快去分享给好友吧'));
		}
	}
};
</script>

<style lang="scss" scoped>
.main {
	padding: 40rpx;

	.group-wrap {
		.title {
			border-left: 10rpx solid $color-1;
			padding-left: 20rpx;
			font-size: 30rpx;
			font-weight: 700;
			margin: 20rpx;
		}

		.text {
			margin: 40rpx 20rpx 60rpx;
		}
	}
}
</style>
